package oj;

import java.util.Scanner;

public class Day22F {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        while(sc.hasNext()){
            int n=sc.nextInt();
            int a=sc.nextInt();
            int[] arr=new int[n];
            for(int i=0 ; i<n ; i++){
                arr[i]=sc.nextInt();
            }
            for(int i=0 ; i<n ; i++){
                if(arr[i]<=a){
                    a+=arr[i];
                }else{
                    a+=math(a,arr[i]);
                }
            }
            System.out.println(a);
        }
    }
    public static int  math(int a, int b){
        int c=0;
        if(a<b){
            c=a;
            a=b;
            b=c;
        }
        c=0;
        while(b!=0){
            c=a%b;
            a=b;
            b=c;
        }
        return a;
    }
}
